package com.moon.mapper;

import com.moon.annotations.DataSource;
import com.moon.pojo.Dept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    @DataSource("db02")
    List<Dept> getAll();



    void addDept(Dept dept);

    @Select("select * from dept where id = #{id}")
    Dept getDept(Integer id, String deptName);

    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    void update(Dept dept);
}
